﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Addmin/BackEnd/MTP_Admin.Master"
    CodeBehind="BC_DoanhThuCH.aspx.cs" Inherits="Bussiness.View.BackEnd.BC_DoanhThuCH" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ext:Panel ID="Panel2" runat="server" Title="Quản lý doanh thu của cửa hàng"
        PaddingSummary="10px 5px 0 5px">
        <Items>
            <ext:FieldSet ID="FieldSet1" runat="server" Layout="ColumnLayout" Title="Thông tin tìm kiếm"
                PaddingSummary="10px 5px 0 5px" Height="70">
                <Items>
                    <ext:Container ID="Container2" runat="server" LabelAlign="Right" Layout="FormLayout"
                        ColumnWidth=".5">
                        <Items>
                            <ext:SelectBox ID="Thang_SelectBox" runat="server" FieldLabel="Chọn tháng" AnchorHorizontal="100%"
                                DataIndex="Status" IDMode="Static" AllowBlank="false">
                                <Items>
                                    <ext:ListItem Text="1" Value="1" />
                                    <ext:ListItem Text="2" Value="2" />
                                    <ext:ListItem Text="3" Value="3" />
                                    <ext:ListItem Text="4" Value="4" />
                                    <ext:ListItem Text="5" Value="5" />
                                    <ext:ListItem Text="6" Value="6" />
                                    <ext:ListItem Text="7" Value="7" />
                                    <ext:ListItem Text="8" Value="8" />
                                    <ext:ListItem Text="9" Value="9" />
                                    <ext:ListItem Text="10" Value="10" />
                                    <ext:ListItem Text="11" Value="11" />
                                    <ext:ListItem Text="12" Value="12" />
                                    <ext:ListItem Text="Cả năm" Value="13" />
                                </Items>
                            </ext:SelectBox>
                        </Items>
                    </ext:Container>
                    <ext:Container ID="Container3" runat="server" LabelAlign="Right" Layout="FormLayout"
                        ColumnWidth=".5">
                        <Items>
                            <ext:Button ID="Button3" runat="server" Text="Tìm kiếm" FieldLabel=" " LabelSeparator=" "
                                Icon="Find">
                                <DirectEvents>
                                    <Click OnEvent="Search" Before="validate">
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:Container>
                </Items>
            </ext:FieldSet>
        </Items>
        <Items>
            <ext:GridPanel ID="DSBH_Grid" IDMode="Static" runat="server" Height="300" AutoScroll="true"
                Region="Center" Title=" ">
                <Store>
                    <ext:Store ID="DSBH_Store" runat="server" AutoDataBind="true" SkipIdForNewRecords="false">
                        <Reader>
                            <ext:JsonReader IDProperty="ID">
                                <Fields>
                                    <ext:RecordField Name="ID" Type="String" Mapping="ID" />
                                    <ext:RecordField Name="PhoneCus" Type="String" Mapping="PhoneCus" />
                                    <ext:RecordField Name="NameCus" Type="String" Mapping="NameCus" />
                                    <ext:RecordField Name="CountProduct" Type="Int" Mapping="CountProduct" />
                                    <ext:RecordField Name="TotalPrice" Type="Int" Mapping="TotalPrice" />
                                    <ext:RecordField Name="TotalImportPrice" Type="Int" Mapping="TotalImportPrice" />
                                    <ext:RecordField Name="Date" Type="Date" Mapping="Date" />
                                    <ext:RecordField Name="NameImployee" Type="String" Mapping="NameImployee" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel2" runat="server" AutoDataBind="true">
                    <Columns>
                        <ext:RowNumbererColumn />
                        <ext:Column ColumnID="ID" Header="Mã" DataIndex="ID" Hidden="true" />
                        <ext:Column Header="Nhân viên" DataIndex="NameImployee" AutoDataBind="true" Width="150"
                            MenuDisabled="True" />
                        <ext:Column Header="Khách Hàng" DataIndex="NameCus" AutoDataBind="true" Width="150"
                            MenuDisabled="True" />
                        <ext:Column Header="Số điện thoại KH" DataIndex="PhoneCus" AutoDataBind="true" Width="100" />
                        <ext:NumberColumn Header="Số lượng SP" DataIndex="CountProduct" AutoDataBind="true"
                            Width="90" MenuDisabled="True" />
                        <ext:NumberColumn Header="Tổng tiền bán" DataIndex="TotalPrice" AutoDataBind="true"
                            MenuDisabled="True" Format="0,00" />
                        <ext:NumberColumn Header="Tổng tiền nhập" DataIndex="TotalImportPrice" AutoDataBind="true"
                            MenuDisabled="True" Format="0,00" />
                        <ext:DateColumn Header="Ngày bán" DataIndex="Date" AutoDataBind="true" MenuDisabled="True"
                            Format="dd/MM/yyyy" />
                        <ext:CommandColumn Header="Chi tiết">
                            <Commands>
                                <ext:GridCommand Icon="NoteEdit" CommandName="Edit" ToolTip-Text="Chi tiết hóa đơn" />
                            </Commands>
                        </ext:CommandColumn>
                    </Columns>
                </ColumnModel>
                <BottomBar>
                    <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" StoreID="DSBH_Store"
                        DisplayInfo="false" />
                </BottomBar>
                <SelectionModel>
                    <ext:RowSelectionModel runat="server" ID="RowSelectionModel1">
                    </ext:RowSelectionModel>
                </SelectionModel>
                <Listeners>
                    <Command Handler="detail(command, record.data.ID)" />
                </Listeners>
            </ext:GridPanel>
            <ext:FieldSet ID="FieldSet2" runat="server" Layout="RowLayout" PaddingSummary="10px 5px 0 5px"
                Height="100" LabelWidth="250">
                <Items>
                    <ext:CompositeField ID="CompositeField2" runat="server">
                        <Items>
                            <ext:NumberField ID="total_buy_price" runat="server" FieldLabel="Tổng giá trị sản phẩm tính theo giá bán"
                                AnchorHorizontal="60%" LabelAlign="Right" IDMode="Static" />
                            <ext:Label ID="Label2" runat="server" Text="VNĐ">
                            </ext:Label>
                        </Items>
                    </ext:CompositeField>
                </Items>
                <Items>
                    <ext:CompositeField ID="CompositeField1" runat="server">
                        <Items>
                            <ext:NumberField ID="total_import_price" runat="server" FieldLabel="Tổng giá trị sản phẩm tính theo giá nhâp"
                                AnchorHorizontal="60%" LabelAlign="Right" IDMode="Static" />
                            <ext:Label ID="Label1" runat="server" Text="VNĐ">
                            </ext:Label>
                        </Items>
                    </ext:CompositeField>
                </Items>
                <Items>
                    <ext:CompositeField runat="server">
                        <Items>
                            <ext:NumberField ID="NumberField1" runat="server" FieldLabel="Tổng tiền lãi" AnchorHorizontal="60%"
                                LabelAlign="Right" IDMode="Static" />
                            <ext:Label runat="server" Text="VNĐ">
                            </ext:Label>
                        </Items>
                    </ext:CompositeField>
                </Items>
            </ext:FieldSet>
        </Items>
        <Buttons>
            <ext:Button runat="server" Text="In bảng kê" ID="them" Icon="Printer">
                <Listeners>
                </Listeners>
            </ext:Button>

        </Buttons>
    </ext:Panel>

    <script type="text/javascript">
      function validate() {
          if (Ext.getCmp('Thang_SelectBox').getValue() == "" || Ext.getCmp('Thang_SelectBox').getValue() == null) {
              Ext.Msg.alert('Lỗi', 'Bạn phải chọn tháng');
              return false;
          }
      }

    </script>

</asp:Content>
